import { parseTime } from "@/utils/ruoyi";

export function useColumns() {
  return [
    {
      type: "select",
      prop: "typeId",
      label: "分类",
      dicUrl: "/api/messageType/list",
      props: {
        label: "typeName",
        value: "id",
      },
      rules: [
        {
          required: true,
          message: "请选择分类",
        },
      ],
    },
    {
      prop: "title",
      label: "标题",
      search: true,
      rules: [
        {
          required: true,
          message: "请输入标题",
        },
      ],
    },
    {
      type: "ueditor",
      span: 24,
      label: "内容",
      prop: "content",
      action: "/api/upload",
    },
    {
      prop: "createTime",
      label: "创建时间",
      display: false,
      formatter: (row: any) => {
        return parseTime(row.createTime);
      },
    },
  ];
}
